package mysql

import "gorm.io/gorm"

type Good struct {
	gorm.Model
	Name     string  `gorm:"type:varchar(40)"`
	Price    float64 `gorm:"type:decimal(10,2)"`
	Num      int64   `gorm:"type:int(11)"`
	ShopName string  `gorm:"type:varchar(40)"`
	UserId   int64   `gorm:"type:int(11)"`
}

func (g *Good) GoodAdd(db *gorm.DB) error {
	return db.Debug().Create(g).Error
}
